home *** CD-ROM | disk | FTP | other *** search
- From: Earle R. Horton
- Subject: Daisy v1.1
- Date: 7 Mar 88 23:53:50 GMT
- Organization: Dartmouth College, Hanover, NH
-
- This the documentation for Daisy v1.1, a User/Chooser configurable printer
- driver for the Mac and man daisy wheel and dot-matrix printers. The printer
- driver is designed to be obvious to use, and most users will hopefully have
- no problems with it. This file covers some of the subtle points of operation,
- which some users will not find obvious. If you decide to distribute Daisy,
- (which you have my permission to do) please include this file.
-
- This is version 1.1 of Daisy, the User/Chooser configurable printer
- driver for Daisy wheel and Dot matrix serial printers.
-
- This is basically the same printer driver documented in the November and
- December, 1987 issues of MacTutor Magazine, with the following
- additions:
-
- a) Converted to MPW C.
- b) Memory management routines extensively optimized by hand
- before compiling. Storage requirements trimmed.
- c) Error checking improved. The driver open routine checks
- for Resource Manager, Memory Manager, and Serial Driver
- errors, and returns the appropriate error code to PrOpen().
- d) Print dialog code overhauled. E.g. the "sideways" item
- in the Job Dialog actually works, and is saved in the
- current Print Record.
- e) If possible, uses the PrGlue trap instead of referencing low
- memory globals when accessing the printer driver's
- device control entry and when setting the error code for
- the print abort condition. If the PrGlue trap is not
- present, then the old method is used.
- f) Compiled and tested on a Mac II, compatible with the
- following:
- i) MultiFinder.
- ii) Machines from 512KE, System 2.0, to Mac II, system 4.2.
- iii) 64 ROMs, I think so. (Let me know, please?)
- iv) Many, many, many applications and printers.
- g) Low-level printer calls now do the correct things in
- almost all cases. Applications which use them should
- produce correct results.
- h) Strings are stored in resources so that the driver can
- be localized as necessary.
-
- Daisy requires Chooser 3.0 or newer (or a resource editor) to configure
- it properly. Before using Daisy for the first time, you should select
- the Daisy icon in the Chooser box, then press the "Setup..." button
- which appears. A dialog box will then appear which will allow you to
- set the baud rate, flow control, and several printer control strings.
- "Top of Page" and "Left Margin" are meant for the low-level routines.
- "Top of Page" should advance the paper to the point where you desire
- printing to start on the page. "Left Margin" should contain enough
- spaces or tabs to provide the correct left margin. A "Line Terminator"
- string is required; you should obtain the correct string to use from
- your printer manual since not all printers use the same string. A caret
- ('^') in front of a character means use the control character. Example:
- Most printers will use CR-LF for "Line Terminator". If this is the case
- with your printer, enter "^M^L" for this parameter. The default
- settings in this version of Daisy are correct for a Tandy DMP-110
- connected to the modem port at 1200 baud, using CTS flow control.
-
- The driver reads in the information set in the Chooser configuration box
- once, at open time. For this reason, you are not usually able to
- reconfigure Daisy from within a running application. Recommended
- procedure for changing Daisy's parameters is to configure Daisy, using
- the Chooser, when in the Finder. The next time you run an application
- which prints with Daisy, the new settings will be used.
-
- IF YOU USE DAISY WITH THE PRINTER PORT, IT IS UP TO YOU TO MAKE SURE
- APPLETALK IS OFF. You can do this within the Chooser, if you have
- version 3.0 or newer. Daisy will just quit if AppleTalk is on and its
- settings say to use the printer port. Depending on what kind of
- error-checking is done by your application, you may get some kind of
- error message.
-
- If you have an older System, which Chooser 3.0 will not run with, or if
- you simply do not have the Chooser 3.0 desk accessory, then it is very
- simple to configure Daisy using ResEdit or REdit.
-
- The printer control strings are in 'STR#' -4080. They are, by
- number:
- 1) Line Terminator.
- 2) Initialize printer
- 3) Top of paper (low-level routines only).
- 4) End of page (usually "^L").
- 5) Left margin (low-level routines only).
- (A bunch of spaces is good here. )
-
- The information for the serial port is in 'HEXA' -8192. ResEdit and
- REdit will edit this type resource as hex data. Daisy interprets it as
- three integers. An integer takes up four characters of hex data. None
- of these integers exceeds 000A. Invalid values will produce undefined
- results, since Daisy is naive and expects the 'HEXA' resource to contain
- only valid data.
-
- data 'HEXA' (-8192, "Printer Settings") {
- $"0000 0002 0000 "
- };
- ^ third integer
- ^second integer
- ^first integer
-
- The first integer tells Daisy what port to use. Allowable values
- are 0000 for the modem port, and 0001 for the printer port. Make
- sure you turn off AppleTalk if you use the printer port.
-
- The second integer determines the baud rate:
-
- 0000 300
- 0001 600
- 0002 1200
- 0003 1800
- 0004 2400
- 0005 3600
- 0006 4800
- 0007 7200
- 0008 9600
- 0009 19200
- 000A 57600
-
- The third integer specifies which type of flow control to use. Use 0000
- for CTS, 0001 for Xon/Xoff. Refer to your printer manual to determine
- which is appropriate. If either can be used, then best results are
- usually obtained with Xon/Xoff.
-
- Recommended font/style: Monaco 9, plain, 11 pixels per line.
-
- Custom 'PREC's (hackers only): Go ahead, enjoy yourself. Daisy will
- reject any 'PREC' it cannot handle. Attempts to produce more than 66
- lines per page are doomed to failure, since that is all I allocate for
- storage. The maximum number of columns is 164.
-
- Other uses: Daisy can be used to "print" from your word processor to and
- serial device, like maybe a modem or mainframe terminal connection.
- Draft copies of documents could be uploaded to a mainframe or other
- microcomputer, for possible use or even printing by the host computer.
-
- Support: This is FREEWARE. I do not support it. LightSpeedC sources
- are available from MacTutor Magazine on the December, 1987 source disk.
- Full instructions are provided in the November and December issues for
- 1987. Building Daisy with LightSpeedC is a royal pain, but it can be
- done. The current (MPW) sources are available from me for $20.00
- American to cover handling. I have made no attempt to maintain
- compatibility between the LightSpeedC sources and the MPW sources, no
- attempt at all. I will not distribute copies of the LightSpeedC
- sources, since I do not feel that would be fair to MacTutor, neither
- will I supply copies of the article on disk. (MacTutor supplies back
- issues through mail order at a fair price.) The MPW sources come with
- all source files necessary to build Daisy, including a Makefile. I do
- not send them out by E-Mail. For $35.00, I will send you an MPW source
- disk via U.S. Post Office overnight mail. Bear with me, people ask
- these kinds of things. I will answer questions about Daisy on the
- phone, but the amount of time I will give you depends on how interesting
- you are to talk to. I do not have the time to supply customized
- versions of Daisy, but there are lots and lots of hungry high school
- kids around who can program in C, or would be willing to try for a few
- bucks, an occasional loan of your car, or a chance to play games on your
- Mac or with your daughter.
-
- *********************************************************************
- *Earle R. Horton, H.B. 8000, Dartmouth College, Hanover, NH 03755 *
- *********************************************************************
-